{{--<script type="text/ng-template" id="signup.tpl">--}}
<div ng-controller="SignupController" class="signup container">
    <div class="card">
        <h1>注册</h1>
        {{--[: User.signup_data :]--}}
        <form name="signup_form" ng-submit="User.signup()">
            <div class="input-group">
                <label for="">用户名</label>
                <input type="text" name="username" id="" title="" ng-model="User.signup_data.username"
                       ng-minlength="4" ng-maxlength="18" required="required"
                       ng-model-options="{ updateOn: 'blur' }">
                <div class="input-error-set" ng-if="signup_form.username.$touched">
                    <div ng-if="signup_form.username.$error.required ">用户名为必填项</div>
                    <div ng-if="signup_form.username.$error.minlength || signup_form.username.$error.maxlength">
                        用户名长度4-18位之间
                    </div>
                    <div ng-if="User.signup_username_exists">
                        用户名已存在
                    </div>
                </div>
            </div>
            <div class="input-group">
                <label for="">密码</label>
                <input type="text" name="password" id="" title="" ng-model="User.signup_data.password"
                       ng-minlength="4" ng-maxlength="18" required="required"
                       ng-model-options="{ updateOn: 'blur' }">
                <div class="input-error-set" ng-if="signup_form.password.$touched">
                    <div ng-if="signup_form.password.$error.required">密码为必填项</div>
                    <div ng-if="signup_form.password.$error.minlength || signup_form.password.$error.maxlength">
                        密码长度4-18位之间
                    </div>
                </div>
            </div>

            <button type="submit" class="primary" ng-disabled="signup_form.$invalid || User.signup_username_exists">
                注册
            </button>
        </form>
    </div>

</div>
{{--</script>--}}
